/*
 * @Description: 
 * @Author: Zhang Zhangda
 * @Date: 2021-02-25 17:37:07
 * @LastEditTime: 2021-02-26 21:40:36
 * @LastEditors: Zhang Zhaoda
 */
//引入axios
import instance from "@/utiles/instance"
//引入type
import {GETCOLORDATA,CHANGECOLORKEY} from "../types/color.types"

//获取type页面数据
export function getColorData(SerialID:string) {
  return (dispatch: any) => {
    instance.get(
      '/api/v2-car-getModelImageYearColor.html',
      {
        params: {
          'SerialID':SerialID
        }
      }).then(res => {
        if(res.data.msg==='成功'){
          dispatch({
            type:GETCOLORDATA,
            list:res.data.data
          })
        }else{
          
        }
        
      })
  }
}
//改变key值
export function changeColorKey(key:string){
  return {
    type:CHANGECOLORKEY,
    colorKey:key
  }
}